<template>
  <casedetail :readonly="false" ref="casedetail" @tabclick="tabclick">
    <div class="cust-panel" slot="cust-panel">
      <archives ref="archives" v-show="activeName == 'archives-info'"/>
    </div>
  </casedetail>
</template>
<script>
import { mapActions, mapGetters, mapState } from "vuex";
import casedetail from "@/views/case/detail/casedetail";
import archives from "@/views/case/detail/archives";
export default {
  data() {
    return {
      detail: {},
      caseDetail: {},
      tabindex: 5,
      activeName:'',
      detail:"",
    };
  },
  components: {
    archives,
    casedetail
  },
  mounted() {
    this.detail = this.$route.params.row;
    this.initPage(this.detail);
  },
  methods: {
    ...mapActions("d2admin/page", ["close"]),
    cancle() {
      this.close({ tagName: "case/archives/detail" });
    },
    async initPage(detail) {
      
      this.$refs.casedetail.initPage(this.detail);
      
      /* this.$refs.casedetail.addtab({ label: "案件卷宗", name: "archives-info" });
      this.activeName = 'archives-info';
      this.$refs.casedetail.activeName = this.activeName; */

      this.$refs.archives.initPage(this.detail);
    },
    tabclick(tab) {
      this.activeName = tab.name;
      //this.$refs.archives.initPage(this.detail);
    },
    
  }
};
</script>

<style lang="scss">

</style>